<?php
	require_once( 'core_DataBaseConnect.php' );
	require_once( 'core_ErrorCode.php' );
	require_once( 'core_Response.php' );
	require_once( 'core_FileManager.php' );
	require_once( 'dao_MemberDAO.php' );
	require_once( 'dao_MemberBusinessDAO.php' );
	require_once( '_configs.php' );
	
	function func( $con, $post, $returnType )
	{
		$login_member_id 	= $post[ 'login_member_id' ];
		// 0. 작성 권한 설정 ( 회원 )
		if( MemberDAO::isAccessable( $con, $login_member_id, array( configs::AUTHOR_ADMIN, configs::AUTHOR_MANAGER, configs::AUTHOR_MEMBER ) ) == false )
		{
			// 작성권한 없음
			return Response::FAIL( ErrorCode::FAIL_WRITE_AUTHOR, "조회 권한이 없습니다.", $returnType );
		}
		
		$response = array();
		// 태그 조회
		$result = MemberBusinessDAO::selectBusinessVote( $con, $login_member_id, $post[ 'businessCode' ] );
		if( $fetch = DataBaseConnect::fetch_assoc( $result ) )
		{
			$response[ 'vote' ] = $fetch[ 'V_CODE' ];
		}
		
		return Response::SUCCESS( $response, $returnType );
	}
?>